"""
Crop patch out of an image
"""
import cv2

def crop(img, bbox=[0, 0, 10, 10]):
    print(img.shape)
    return img[bbox[0]: bbox[2], bbox[1]: bbox[3]]

if __name__ == '__main__':
    print('Crop images')
    # img_path = 'Goose_QP16-001.jpeg'
    # img_path = 'Goose_QP35-001.jpeg'
    # img_path = 'Goose_QP50-001.jpeg'
    img_path = '/DATA3_DB7/data/weixionglin/AVQA/boxing/Boxing_QP16/Boxing_QP16-010.jpeg'
    img = cv2.imread(img_path)
    cropped_img = crop(img, [200,600,600,1000])  # wave
    # cropped_img = crop(img, [300,500,600,800])  # goose
    print(cropped_img.shape)
    cv2.imwrite('croped_boxing.jpg', cropped_img)
